<!DOCTYPE html>
<html class="writer-html5" lang="zh-CN">
<head>
  <meta charset="utf-8" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" />

  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>弧形指示器 &mdash; SGL 0.1 文档</title>
      <link rel="stylesheet" type="text/css" href="../../_static/pygments.css" />
      <link rel="stylesheet" type="text/css" href="../../_static/css/theme.css" />
      <link rel="stylesheet" type="text/css" href="../../_static/togglebutton.css" />
      <link rel="stylesheet" type="text/css" href="../../_static/copybutton.css" />

  
  <!--[if lt IE 9]>
    <script src="../../_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
        <script data-url_root="../../" id="documentation_options" src="../../_static/documentation_options.js"></script>
        <script src="../../_static/jquery.js"></script>
        <script src="../../_static/underscore.js"></script>
        <script src="../../_static/_sphinx_javascript_frameworks_compat.js"></script>
        <script src="../../_static/doctools.js"></script>
        <script src="../../_static/clipboard.min.js"></script>
        <script src="../../_static/copybutton.js"></script>
        <script>let toggleHintShow = 'Click to show';</script>
        <script>let toggleHintHide = 'Click to hide';</script>
        <script>let toggleOpenOnPrint = 'true';</script>
        <script src="../../_static/togglebutton.js"></script>
        <script src="../../_static/translations.js"></script>
        <script>var togglebuttonSelector = '.toggle, .admonition.dropdown';</script>
    <script src="../../_static/js/theme.js"></script>
    <link rel="index" title="索引" href="../../genindex.html" />
    <link rel="search" title="搜索" href="../../search.html" />
    <link rel="next" title="进度条" href="pgsbar.html" />
    <link rel="prev" title="开关按钮" href="switch.html" />
    <link href="../../_static/style.css" rel="stylesheet" type="text/css">

</head>

<body class="wy-body-for-nav"> 
  <div class="wy-grid-for-nav">
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search" >

          
          
          <a href="../../index.html" class="icon icon-home">
            SGL
          </a>
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>
        </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
              <p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../introduce.html">SGL简介</a></li>
<li class="toctree-l1"><a class="reference internal" href="../transplant.html">SGL使用指南</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../guide.html">SGL开发手册</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="page.html">页面</a></li>
<li class="toctree-l2"><a class="reference internal" href="button.html">按钮</a></li>
<li class="toctree-l2"><a class="reference internal" href="label.html">标签</a></li>
<li class="toctree-l2"><a class="reference internal" href="app_icon.html">应用图标</a></li>
<li class="toctree-l2"><a class="reference internal" href="switch.html">开关按钮</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">弧形指示器</a></li>
<li class="toctree-l2"><a class="reference internal" href="pgsbar.html">进度条</a></li>
<li class="toctree-l2"><a class="reference internal" href="checkbox.html">勾选框</a></li>
<li class="toctree-l2"><a class="reference internal" href="radiobtn.html">单选框</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../debug/debug.html">调试</a></li>
</ul>

        </div>
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../../index.html">SGL</a>
      </nav>

      <div class="wy-nav-content">
        <div class="rst-content">
          <div role="navigation" aria-label="Page navigation">
  <ul class="wy-breadcrumbs">
      <li><a href="../../index.html" class="icon icon-home" aria-label="Home"></a></li>
          <li class="breadcrumb-item"><a href="../guide.html">SGL开发手册</a></li>
      <li class="breadcrumb-item active">弧形指示器</li>
      <li class="wy-breadcrumbs-aside">
            <a href="../../_sources/docs/guide/arcbar.rst.txt" rel="nofollow"> View page source</a>
      </li>
  </ul>
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
             
  <section id="id1">
<h1>弧形指示器<a class="headerlink" href="#id1" title="Permalink to this heading">¶</a></h1>
<p>添加弧形指示器代码如下：</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="linenos"> 1</span><span class="w"> </span><span class="c1">//定义一个样式，主体颜色为SGL_BLUE，文本颜色为SGL_RED，圆角半径为16</span>
<span class="linenos"> 2</span><span class="w"> </span><span class="n">sgl_style_t</span><span class="w"> </span><span class="n">arcbar_style</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">{.</span><span class="n">body_color</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">SGL_BLUE</span><span class="p">,</span><span class="w"> </span><span class="p">.</span><span class="n">text_color</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">SGL_RED</span><span class="p">};</span>
<span class="linenos"> 3</span><span class="w"> </span><span class="c1">//创建一个弧形指示器对象</span>
<span class="linenos"> 4</span><span class="w"> </span><span class="n">sgl_obj_t</span><span class="w"> </span><span class="o">*</span><span class="n">arcbar</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">sgl_arcbar_create</span><span class="p">(</span><span class="n">main_page</span><span class="p">,</span><span class="w"> </span><span class="mi">50</span><span class="p">);</span>
<span class="linenos"> 5</span><span class="w"> </span><span class="c1">//设置弧形指示器的大小为宽100和高100</span>
<span class="linenos"> 6</span><span class="w"> </span><span class="n">sgl_obj_set_size</span><span class="p">(</span><span class="n">arcbar</span><span class="p">,</span><span class="w"> </span><span class="mi">50</span><span class="p">,</span><span class="w"> </span><span class="mi">50</span><span class="p">);</span>
<span class="linenos"> 7</span><span class="w"> </span><span class="c1">//设置弧形指示器的样式为arcbar_style</span>
<span class="linenos"> 8</span><span class="w"> </span><span class="n">sgl_obj_set_style</span><span class="p">(</span><span class="n">arcbar</span><span class="p">,</span><span class="w"> </span><span class="o">&amp;</span><span class="n">arcbar_style</span><span class="p">);</span>
<span class="linenos"> 9</span><span class="w"> </span><span class="c1">//设置弧形指示器的位置为x坐标170, y坐标120</span>
<span class="linenos">10</span><span class="w"> </span><span class="n">sgl_obj_set_pos</span><span class="p">(</span><span class="n">arcbar</span><span class="p">,</span><span class="w"> </span><span class="mi">20</span><span class="p">,</span><span class="w"> </span><span class="mi">120</span><span class="p">);</span>
<span class="linenos">11</span><span class="w"> </span><span class="c1">//设置弧形指示器的字体</span>
<span class="linenos">12</span><span class="w"> </span><span class="n">sgl_arcbar_set_font</span><span class="p">(</span><span class="n">arcbar</span><span class="p">,</span><span class="w"> </span><span class="o">&amp;</span><span class="n">song23</span><span class="p">);</span>
<span class="linenos">13</span><span class="w"> </span><span class="c1">//设置弧形指示器的厚度为10</span>
<span class="linenos">14</span><span class="w"> </span><span class="n">sgl_arcbar_set_thick</span><span class="p">(</span><span class="n">arcbar</span><span class="p">,</span><span class="w"> </span><span class="mi">3</span><span class="p">);</span>
</pre></div>
</div>
<img alt="arcbar demo" src="../../_images/arcbar_test.png" />
</section>


           </div>
          </div>
          <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
        <a href="switch.html" class="btn btn-neutral float-left" title="开关按钮" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
        <a href="pgsbar.html" class="btn btn-neutral float-right" title="进度条" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
    </div>

  <hr/>

  <div role="contentinfo">
    <p>&#169; 版权所有 2024, li-shanwen.</p>
  </div>

  Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
    <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
    provided by <a href="https://readthedocs.org">Read the Docs</a>.
   

</footer>
        </div>
      </div>
    </section>
  </div>
  <script>
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script> 

</body>
</html>